import axios from 'axios'

const zadigToken =
  'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoi6Ien5b-g5Y2OIiwiZW1haWwiOiJ6YW5nemhvbmdodWFAaG9zZWNsb3VkLmNvbSIsInVpZCI6Ijk0MzJjNzAxLTE2YzQtMTFlZC05MTljLTkyNDAyMDYyNDQ0MyIsInByZWZlcnJlZF91c2VybmFtZSI6Inphbmd6aG9uZ2h1YSIsImZlZGVyYXRlZF9jbGFpbXMiOnsiY29ubmVjdG9yX2lkIjoib2F1dGgiLCJ1c2VyX2lkIjoiemFuZ3pob25naHVhIn0sImF1ZCI6InphZGlnIiwiZXhwIjo0ODE4MTMzMjc5fQ.Tj0eTn-SnT3Pr-BsY5jQXdUkgBwxZo9LXMWJhZSK8lI'

const zadigApi = {
  Workflows:
    'https://ci.ekuaibao.com/api/aslan/workflow/v4?project=ui-auto-test&view_name=&page_num=1&page_size=500&projectName=ui-auto-test',
}

export function getWorkflows() {
  axios({
    method: 'get',
    url: zadigApi.Workflows,
    withCredentials: true,
    headers: {
      Authorization: `Bearer ${zadigToken}`,
    },
  })
    .then((res: any) => {
      return res.data
    })
    .catch((err: any) => {
      console.log(err)
    })
}
